package com.dongdongshop.config.datasource;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/*
* 阿里巴巴德鲁伊连接池配置
* */
@Configuration
public class DruidDataSourceConfig {

    @Bean
    @ConfigurationProperties(prefix = "spring.datasource")//读取全局配置文件
    public DataSource druidDataSource(){
        return new DruidDataSource();
    }
}
